﻿using System;
using System.Collections.Generic;
using System.Text;

namespace GenericDemo
{

    public interface IBaseCrudVM<out T, out S> where T : TopBasePoco<S>
    {
        T Entity { get;  }
        void DoDelete();
    }

    public class BaseCRUDVM<T,S> : IBaseCrudVM<T,S> where T: TopBasePoco<S>
    {
        public T Entity { get; set; }

        public virtual void DoDelete()
        {
            Console.WriteLine($"delete from {Entity.GetType().Name} where id={Entity.ID}");
        }

    }

}
